﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using XCommunity.Views;

namespace XCommunity.Web.UI
{

  [ParseChildren( false )]
  [PersistChildren( false )]
  public class Presenter : Control, IPresenter
  {

    private ViewObject _viewObject;

    public Presenter()
    {

    }

    public Presenter( ViewObject viewObject )
    {
      _viewObject = viewObject;
    }

    



    #region IPresenter 成员

    public ViewObject View
    {
      get { return _viewObject; }
      set
      {
        if ( _viewObject == value )
          return;

        if ( _viewObject != null )
          throw new InvalidOperationException( "视图对象设置后便不可被修改" );//UNDONE 异常详细信息
        _viewObject = value;
      }
    }

    #endregion
  }
}
